<template>
  <div class="index">
    <!-- 二级路由的占位标签 -->
    <transition name="fade" mode="out-in">
      <keep-alive :max="5" include="Mine,Order">
        <router-view></router-view>
      </keep-alive>
    </transition>

      <!-- 底部导航 -->
    <div class="tabbar">
    <!-- <router-link to="/index/home">首页</router-link>
    <router-link to="/index/tuan">爆爆团</router-link>
    <router-link to="/index/order">订单</router-link>
    <router-link to="/index/mine">我的</router-link> -->
    <van-tabbar v-model="active">
        <van-tabbar-item to="/index/home" icon="home-o">首页</van-tabbar-item>
        <van-tabbar-item to="/index/tuan" icon="search">爆爆团</van-tabbar-item>
        <van-tabbar-item to="/index/order" icon="friends-o">订单</van-tabbar-item>
        <van-tabbar-item to="/index/mine" icon="setting-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
  
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
    };
  },
}
</script>

<style lang='scss' scoped>
.tabbar{
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 10px 0;
  border-top: 1px solid #ccc;
  background-color: #fff;
}  

/* 入场动画 */
.fade-enter{ /*动画开始时的状态*/
  /* opacity: 0; */
  /* transform:scale(0); */
  transform:rotate(0deg);
  /* transform:scale(0) rotate(0deg); */
}
.fade-enter-active{
  transition: all 0.2s;
}
.fade-enter-to{ /*动画结束时的状态*/
  opacity: 1;
  /* transform:scale(1); */
  transform:rotate(360deg);
  /* transform:scale(1) rotate(360deg); */
}

/* 离场动画 */
.fade-leave{ /*动画开始时的状态*/
  opacity: 1;
  /* transform:scale(1) rotate(360deg); */
  transform:rotate(360deg);
}
.fade-leave-active{
  transition: all 0.2s;
}
.fade-leave-to{ /*动画结束时的状态*/
  opacity: 0;
  /* transform:scale(0) rotate(0deg); */
  transform:rotate(0deg);
}
</style>